var that;
App({
  onLaunch: function () {
    that=this
    that.globalData = {}
    wx.cloud.init({
        env: 'cloud2-4gncvam39e2323e9',//云开发环境
        traceUser: true,
    })
    that.globalData.db = wx.cloud.database()
  },

  /* 判断数据库中是否已经有当前用户的信息 */
  hasUserInfo:async function(){
    //小程序本地缓存是否有用户信息
    if (that.globalData.userInfo) return true

    //查询数据库中用户信息
    var isHasUserInfo = false;
    await wx.cloud.callFunction({
      name:"getUserMessage"
    }).then(res => {
      if(res.result.code == 200){
        that.globalData.userInfo = res.result.data
        isHasUserInfo = true
      }
    })
    return isHasUserInfo
  },
    "usingComponents": {
      "i-radio-group": "../dist/radio-group/index",
      "i-radio": "../dist/radio/index"
  },
})

